<?php
declare (strict_types = 1);

namespace app\model;

use think\Model;

/**
 * @mixin \think\Model
 */
class OrderGoods extends Model
{
//    绑定表
    protected $table='month_exam_order_goods';

    /**
     * @param $data
     * @return int|string
     * 向订单商品表添加数据
     */
    public function addOrderGoods($data){
        return $this->insert($data);
    }

    /**
     * @return \think\model\relation\BelongsTo
     * 与商品表关联
     */
    public function goodsData(){
        return $this->belongsTo(Goods::class,'goods_id');
    }
}
